import service from "@/api/index.js";
import qs from 'qs';
const UserApi= {
    //验证码
    captcha(){
        return service.get("/user/captcha");
    },
    reg(user){
       return service.post("/user/reg",qs.stringify(user));

    },
    login(user){
        return service.post("/user/login",qs.stringify(user));

    },
    getInfo() {
        return service.get("/user/info")
    },//修改
    update(user) {
        return service.put("/user/chgInfo",user);
    },//充值
    updateMoney(user) {
        return service.put("/user/updateMoney",user);
    },//修改支付密码
    updatePayPwd(updatePayPwd) {
        return service.put("/user/updatePayPwd", qs.stringify(updatePayPwd))
    },//修改登录密码
    updatePwd(updatePwd) {
        return service.put("/user/updatePwd", qs.stringify(updatePwd))
    },//设置支付密码
    updateSetPwd(updatePayPwd) {
        return service.put("/user/updateSetPwd", qs.stringify(updatePayPwd))
    },
    //修改账号状态---认证
    updateCertifying(user) {
        return service.put("/user/updateCertifying",user);
    },
    selectByPage(condition,pageNum,pageSize){
        condition.pageNum = pageNum;
        condition.pageSize = pageSize;
        return service.get("/user/All",{
            params: condition
        })
    },
    resetPwd(id){
        return service.put(`/user/${id}`)
    },
    updateStatus(user){
        return  service.put("/user/Status",user)
    }
};
export default UserApi